#./dockerpush.sh google_containers/kubernetes-dashboard-amd64 v1.5.0 gcr.io
if [ $# -lt 2 ]
then
	echo 用途：将本地镜像上传到dokcerhub.ygsoft.com:5000
	echo usage: ./dockerpush.sh image version server
	exit
fi
image=$1
version=$2
server=$3
dockerhub="dockerhub.ygsoft.com:5000/"

if [ $# -eq 3 ]
then
  server=$3/
fi

set -x

#docker pull $server${image}:${version}
docker tag ${server}${image}:${version} ${dockerhub}${image}:${version}
docker push ${dockerhub}${image}:${version}
docker rmi ${dockerhub}${image}:${version}
